package com.example.aerospacemanagementsystem.controller.logistics;

import com.example.aerospacemanagementsystem.entity.logistics.Emoloyeer;
import com.example.aerospacemanagementsystem.service.logisticsService.impl.EmoloyeerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 李铭
 */

@Api(tags = "人员")
@RestController
@CrossOrigin
@RequestMapping("/emoloyeer")
public class EmoployeerMapper {
    @Autowired
    private EmoloyeerService emoloyeerService;

    @PostMapping
    public int add(@RequestBody Emoloyeer emoloyeer){
        return emoloyeerService.add(emoloyeer);
    }

    @DeleteMapping
    public int delete(Emoloyeer emoloyeer){
        return emoloyeerService.delete(emoloyeer);
    }

    @PutMapping
    public int update(@RequestBody Emoloyeer emoloyeer){
        return emoloyeerService.update(emoloyeer);
    }

    @GetMapping("/getAll")
    public List<Emoloyeer> getAllCity(Emoloyeer emoloyeer) {
        List<Emoloyeer> list = emoloyeerService.getAllEmoloyeer(emoloyeer);
        return list;
    }
}
